<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_gpio.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__gpio_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">mod_gpio.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>GPIO control module.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="io_8h_source.html">io.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sys_8h_source.html">sys.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mod__msg_8h_source.html">mod_msg.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mod__gpio_8h_source.html">mod_gpio.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:add17353cd876e503abc3fa755f5baca7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#add17353cd876e503abc3fa755f5baca7">gpio_module_init</a> ()</td></tr>
<tr class="memdesc:add17353cd876e503abc3fa755f5baca7"><td class="mdescLeft">&#160;</td><td class="mdescRight">module init  <a href="#add17353cd876e503abc3fa755f5baca7">More...</a><br /></td></tr>
<tr class="separator:add17353cd876e503abc3fa755f5baca7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d3aaed2e4c7b9fc6e3619d087c6aac3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a0d3aaed2e4c7b9fc6e3619d087c6aac3">gpio_pin_setup_for_output</a> (uint32_t port, uint32_t pin)</td></tr>
<tr class="memdesc:a0d3aaed2e4c7b9fc6e3619d087c6aac3"><td class="mdescLeft">&#160;</td><td class="mdescRight">set pin mode to OUTPUT  <a href="#a0d3aaed2e4c7b9fc6e3619d087c6aac3">More...</a><br /></td></tr>
<tr class="separator:a0d3aaed2e4c7b9fc6e3619d087c6aac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68a572d2c6ed3a3b5d5a75def0f78cc5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a68a572d2c6ed3a3b5d5a75def0f78cc5">gpio_pin_setup_for_input</a> (uint32_t port, uint32_t pin)</td></tr>
<tr class="memdesc:a68a572d2c6ed3a3b5d5a75def0f78cc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">set pin mode to INPUT  <a href="#a68a572d2c6ed3a3b5d5a75def0f78cc5">More...</a><br /></td></tr>
<tr class="separator:a68a572d2c6ed3a3b5d5a75def0f78cc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3f870ee59aefb0a99bd6cc4e7d7fd58"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#ad3f870ee59aefb0a99bd6cc4e7d7fd58">gpio_pin_get</a> (uint32_t port, uint32_t pin)</td></tr>
<tr class="memdesc:ad3f870ee59aefb0a99bd6cc4e7d7fd58"><td class="mdescLeft">&#160;</td><td class="mdescRight">get pin state  <a href="#ad3f870ee59aefb0a99bd6cc4e7d7fd58">More...</a><br /></td></tr>
<tr class="separator:ad3f870ee59aefb0a99bd6cc4e7d7fd58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23cdd4156dd0a9e343f6cc7e9396d6a2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a23cdd4156dd0a9e343f6cc7e9396d6a2">gpio_pin_set</a> (uint32_t port, uint32_t pin)</td></tr>
<tr class="memdesc:a23cdd4156dd0a9e343f6cc7e9396d6a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">set pin state to HIGH (1)  <a href="#a23cdd4156dd0a9e343f6cc7e9396d6a2">More...</a><br /></td></tr>
<tr class="separator:a23cdd4156dd0a9e343f6cc7e9396d6a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f4fd583d7d2c87e80487e15e9b1565a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a6f4fd583d7d2c87e80487e15e9b1565a">gpio_pin_clear</a> (uint32_t port, uint32_t pin)</td></tr>
<tr class="memdesc:a6f4fd583d7d2c87e80487e15e9b1565a"><td class="mdescLeft">&#160;</td><td class="mdescRight">set pin state to LOW (0)  <a href="#a6f4fd583d7d2c87e80487e15e9b1565a">More...</a><br /></td></tr>
<tr class="separator:a6f4fd583d7d2c87e80487e15e9b1565a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2979b18350aa4ac94e0a9ae8026dc735"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a2979b18350aa4ac94e0a9ae8026dc735">gpio_port_get</a> (uint32_t port)</td></tr>
<tr class="memdesc:a2979b18350aa4ac94e0a9ae8026dc735"><td class="mdescLeft">&#160;</td><td class="mdescRight">get port state  <a href="#a2979b18350aa4ac94e0a9ae8026dc735">More...</a><br /></td></tr>
<tr class="separator:a2979b18350aa4ac94e0a9ae8026dc735"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba8f0bc9701f36e3048dbefc81518054"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#aba8f0bc9701f36e3048dbefc81518054">gpio_port_set</a> (uint32_t port, uint32_t mask)</td></tr>
<tr class="memdesc:aba8f0bc9701f36e3048dbefc81518054"><td class="mdescLeft">&#160;</td><td class="mdescRight">set port pins state by mask  <a href="#aba8f0bc9701f36e3048dbefc81518054">More...</a><br /></td></tr>
<tr class="separator:aba8f0bc9701f36e3048dbefc81518054"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdcdd3eb9af000552dc8f1a54b7a659c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#afdcdd3eb9af000552dc8f1a54b7a659c">gpio_port_clear</a> (uint32_t port, uint32_t mask)</td></tr>
<tr class="memdesc:afdcdd3eb9af000552dc8f1a54b7a659c"><td class="mdescLeft">&#160;</td><td class="mdescRight">clear port pins state by mask  <a href="#afdcdd3eb9af000552dc8f1a54b7a659c">More...</a><br /></td></tr>
<tr class="separator:afdcdd3eb9af000552dc8f1a54b7a659c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fc4234962ca0dfcb1c8a81b5a863668"><td class="memItemLeft" align="right" valign="top">int8_t volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a4fc4234962ca0dfcb1c8a81b5a863668">gpio_msg_recv</a> (uint8_t type, uint8_t *msg, uint8_t length)</td></tr>
<tr class="memdesc:a4fc4234962ca0dfcb1c8a81b5a863668"><td class="mdescLeft">&#160;</td><td class="mdescRight">"message received" callback  <a href="#a4fc4234962ca0dfcb1c8a81b5a863668">More...</a><br /></td></tr>
<tr class="separator:a4fc4234962ca0dfcb1c8a81b5a863668"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a4c7ffa9d73e9b28219932f5a05140099"><td class="memItemLeft" align="right" valign="top">volatile uint32_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__gpio_8c.html#a4c7ffa9d73e9b28219932f5a05140099">gpio_port_data</a> [<a class="el" href="mod__gpio_8h.html#a188c33baad9a9f4dffd2ed5040b274c7">GPIO_PORTS_CNT</a>]</td></tr>
<tr class="separator:a4c7ffa9d73e9b28219932f5a05140099"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>GPIO control module. </p>
<p>This module implements an API to GPIO functionality for other modules </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="add17353cd876e503abc3fa755f5baca7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add17353cd876e503abc3fa755f5baca7">&#9670;&nbsp;</a></span>gpio_module_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_module_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>module init </p>
<dl class="section note"><dt>Note</dt><dd>call this function only once before gpio_module_base_thread() </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a1">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a0d3aaed2e4c7b9fc6e3619d087c6aac3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d3aaed2e4c7b9fc6e3619d087c6aac3">&#9670;&nbsp;</a></span>gpio_pin_setup_for_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_pin_setup_for_output </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set pin mode to OUTPUT </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number (0 .. GPIO_PINS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a2">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a68a572d2c6ed3a3b5d5a75def0f78cc5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68a572d2c6ed3a3b5d5a75def0f78cc5">&#9670;&nbsp;</a></span>gpio_pin_setup_for_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_pin_setup_for_input </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set pin mode to INPUT </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number (0 .. GPIO_PINS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad3f870ee59aefb0a99bd6cc4e7d7fd58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3f870ee59aefb0a99bd6cc4e7d7fd58">&#9670;&nbsp;</a></span>gpio_pin_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t gpio_pin_get </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get pin state </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number (0 .. GPIO_PINS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>(HIGH) </td></tr>
    <tr><td class="paramname">0</td><td>(LOW) </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a4">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a23cdd4156dd0a9e343f6cc7e9396d6a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a23cdd4156dd0a9e343f6cc7e9396d6a2">&#9670;&nbsp;</a></span>gpio_pin_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_pin_set </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set pin state to HIGH (1) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number (0 .. GPIO_PINS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a6">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a6f4fd583d7d2c87e80487e15e9b1565a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f4fd583d7d2c87e80487e15e9b1565a">&#9670;&nbsp;</a></span>gpio_pin_clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_pin_clear </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set pin state to LOW (0) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number (0 .. GPIO_PINS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a5">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a2979b18350aa4ac94e0a9ae8026dc735"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2979b18350aa4ac94e0a9ae8026dc735">&#9670;&nbsp;</a></span>gpio_port_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t gpio_port_get </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get port state </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>each bit value of returned value represents port pin state </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>.. 0xFFFFFFFF </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a8">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="aba8f0bc9701f36e3048dbefc81518054"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba8f0bc9701f36e3048dbefc81518054">&#9670;&nbsp;</a></span>gpio_port_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_port_set </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set port pins state by mask </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">mask</td><td>GPIO pins mask to set (0 .. 0xFFFFFFFF) <br />
<br />
 mask examples: <br />
<br />
 mask = 0xFFFFFFFF (0b11111111111111111111111111111111) means <b>set all pins state to 1 (HIGH)</b> <br />
 mask = 0x00000001 (0b1) means <b>set pin 0 state to 1 (HIGH)</b> <br />
 mask = 0x0000000F (0b1111) means <b>set pins 0,1,2,3 states to 1 (HIGH)</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a10">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="afdcdd3eb9af000552dc8f1a54b7a659c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afdcdd3eb9af000552dc8f1a54b7a659c">&#9670;&nbsp;</a></span>gpio_port_clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gpio_port_clear </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>clear port pins state by mask </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>GPIO port number (0 .. GPIO_PORTS_CNT) </td></tr>
    <tr><td class="paramname">mask</td><td>GPIO pins mask to clear (0 .. 0xFFFFFFFF) <br />
<br />
 mask examples: <br />
<br />
 mask = 0xFFFFFFFF (0b11111111111111111111111111111111) means <b>set all pins state to 0 (LOW)</b> <br />
 mask = 0x00000003 (0b11) means <b>set pins 0,1 states to 0 (LOW)</b> <br />
 mask = 0x00000008 (0b1000) means <b>set pin 3 state to 0 (LOW)</b></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_gpio_8c-example.html#a9">mod_gpio.c</a>.</dd>
</dl>
</div>
</div>
<a id="a4fc4234962ca0dfcb1c8a81b5a863668"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fc4234962ca0dfcb1c8a81b5a863668">&#9670;&nbsp;</a></span>gpio_msg_recv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t volatile gpio_msg_recv </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>"message received" callback </p>
<dl class="section note"><dt>Note</dt><dd>this function will be called automatically when a new message will arrive for this module.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>user defined message type (0..0xFF) </td></tr>
    <tr><td class="paramname">msg</td><td>pointer to the message buffer </td></tr>
    <tr><td class="paramname">length</td><td>the length of a message (0..MSG_LEN)</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>(message read) </td></tr>
    <tr><td class="paramname">-1</td><td>(message not read) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a4c7ffa9d73e9b28219932f5a05140099"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c7ffa9d73e9b28219932f5a05140099">&#9670;&nbsp;</a></span>gpio_port_data</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile uint32_t* gpio_port_data[<a class="el" href="mod__gpio_8h.html#a188c33baad9a9f4dffd2ed5040b274c7">GPIO_PORTS_CNT</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">=</div><div class="line">{</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04ae3d8a811f3bf7196f361be4104db68db">PA</a> * <a class="code" href="mod__gpio_8h.html#a3f5c8ef16699d8fd3b0fc4cb524a4547">GPIO_BANK_SIZE</a>) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a8b7dd81ba2f0d15957795457d92ce139">PB</a> * <a class="code" href="mod__gpio_8h.html#a3f5c8ef16699d8fd3b0fc4cb524a4547">GPIO_BANK_SIZE</a>) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04aa2c62b62b658ac45e83749e9e9c1cb46">PC</a> * GPIO_BANK_SIZE) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04aefbc069e0ac4cd293f3ba527bec2befe">PD</a> * <a class="code" href="mod__gpio_8h.html#a3f5c8ef16699d8fd3b0fc4cb524a4547">GPIO_BANK_SIZE</a>) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a84a0e8421125bc6ef85e43bab494f68c">PE</a> * GPIO_BANK_SIZE) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04ac1b9838c8d86ff9cdb39757140ebc8ae">PF</a> * <a class="code" href="mod__gpio_8h.html#a3f5c8ef16699d8fd3b0fc4cb524a4547">GPIO_BANK_SIZE</a>) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a> + <a class="code" href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a4921b18e1718d2cec29b1da3e2439ef7">PG</a> * GPIO_BANK_SIZE) + 16 ),</div><div class="line">    (uint32_t *) ( (<a class="code" href="mod__gpio_8h.html#a57257f1f2d756db5acf0a17fd6320ed1">GPIO_R_BASE</a>                    ) + 16 )</div><div class="line">}</div><div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04ac1b9838c8d86ff9cdb39757140ebc8ae"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04ac1b9838c8d86ff9cdb39757140ebc8ae">PF</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_a57257f1f2d756db5acf0a17fd6320ed1"><div class="ttname"><a href="mod__gpio_8h.html#a57257f1f2d756db5acf0a17fd6320ed1">GPIO_R_BASE</a></div><div class="ttdeci">#define GPIO_R_BASE</div><div class="ttdoc">GPIO R registers block start address. </div><div class="ttdef"><b>Definition:</b> mod_gpio.h:20</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04a8b7dd81ba2f0d15957795457d92ce139"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a8b7dd81ba2f0d15957795457d92ce139">PB</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04ae3d8a811f3bf7196f361be4104db68db"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04ae3d8a811f3bf7196f361be4104db68db">PA</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04aefbc069e0ac4cd293f3ba527bec2befe"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04aefbc069e0ac4cd293f3ba527bec2befe">PD</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_a3f5c8ef16699d8fd3b0fc4cb524a4547"><div class="ttname"><a href="mod__gpio_8h.html#a3f5c8ef16699d8fd3b0fc4cb524a4547">GPIO_BANK_SIZE</a></div><div class="ttdeci">#define GPIO_BANK_SIZE</div><div class="ttdef"><b>Definition:</b> mod_gpio.h:21</div></div>
<div class="ttc" id="mod__gpio_8h_html_acce3b8a909ed8b957b4e411dfb7cbd91"><div class="ttname"><a href="mod__gpio_8h.html#acce3b8a909ed8b957b4e411dfb7cbd91">GPIO_BASE</a></div><div class="ttdeci">#define GPIO_BASE</div><div class="ttdoc">GPIO registers block start address. </div><div class="ttdef"><b>Definition:</b> mod_gpio.h:19</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04a4921b18e1718d2cec29b1da3e2439ef7"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a4921b18e1718d2cec29b1da3e2439ef7">PG</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04aa2c62b62b658ac45e83749e9e9c1cb46"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04aa2c62b62b658ac45e83749e9e9c1cb46">PC</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
<div class="ttc" id="mod__gpio_8h_html_abc6126af1d45847bc59afa0aa3216b04a84a0e8421125bc6ef85e43bab494f68c"><div class="ttname"><a href="mod__gpio_8h.html#abc6126af1d45847bc59afa0aa3216b04a84a0e8421125bc6ef85e43bab494f68c">PE</a></div><div class="ttdef"><b>Definition:</b> mod_gpio.h:30</div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__gpio_8c.html">mod_gpio.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
